To ensure data security in a storage system, a multi-copy storage technology is generally used to implement data redundancy backup. With the multi-copy storage technology, multiple same copies of data are stored, and when a piece of data is lost, the lost data can be restored using data in another copy, so as to reduce a data loss probability. A rise in a quantity of copies greatly increases consumption of system storage space and network bandwidth, resulting in an increase of data storage costs. If there are two copies, space actually available for a user is 50% of total storage space of an entire system. If there are three copies, space actually available for the user is only 33%.
Because of a waste of storage space in using the multi-copy storage technology, a current distributed storage system increasingly uses an erasure code (EC) technology to store data. Currently, Reed-Solomon erasure code is widely applied in the storage field. A specific principle of the Reed-Solomon erasure code is data is divided into m data blocks, check encoding is performed on the m data blocks using a redundancy algorithm, multiplication is performed on an encoding matrix and the m data blocks to generate k check blocks, and the m data blocks and the k check blocks constitute an EC stripe. Because a matrix operation is reversible, when k or less blocks of the m+k blocks in the EC stripe are lost, data in the lost blocks can be restored.
Compared with the multi-copy storage technology, the erasure code coding technology undoubtedly improves storage space utilization greatly. However, introduction of an extra encoding and decoding operation has an additional requirement for a computation capability of a distributed storage system.